package com.time.sky.controller;

import com.time.sky.entity.Fitment;
import com.time.sky.mapper.FitmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController

public class FitmentController {
    @Autowired
    private FitmentMapper fitmentMapper;

    @CrossOrigin
    @RequestMapping("/fitment/selectFitmentListOne")
    public List<Fitment> selectFitmentList(@RequestBody Fitment fitment) {
        return fitmentMapper.selectFitment(fitment);
    }

    @CrossOrigin
    @RequestMapping("/fitment/selectFitmentList")
    public List<Fitment> findAll() {
        return fitmentMapper.findAll();
    }

}
